package pack1;

public class java5 {
    public static void main(String[] args){
    int arry[][]=new int[5][6];
        int brry[]=new int[5];
        int crry[]=new int[6];
        for (int i = 0; i < 5; i++)
            for (int j = 0; j < 6; j++) {
                arry[i][j]=i*i-(j-i)*(j-i)+10;
                System.out.println("arry["+ i +"]["+ j +"]"+"="+arry[i][j]);
            }
        for (int i = 0; i < 5; i++) {
            brry[i]=arry[i][0];
            for (int j = 0; j < 6; j++) {
                  if(brry[i]<arry[i][j])
                      brry[i]=arry[i][j];
            }
        }
        for (int j = 0; j < 6; j++) {
            crry[j]=arry[0][j];
            for (int i = 0; i < 5; i++) {
                if(crry[j]<arry[i][j])
                    crry[j]=arry[i][j];
            }
        }
        for (int i = 0; i < 5; i++) {
            System.out.println("第"+(i+1)+"行的最大值"+"="+brry[i]);
        }
        for (int j = 0; j < 6; j++) {
            System.out.println("第"+(j+1)+"列的最大值"+"="+crry[j]);
        }
    }
}
